import request from '@/utils/request'

// 封装一个获取部门列表的接口
export function deptListAPI () {
    return request({
        url: '/company/department'
    })
}

// 封装一个删除部门的接口
export function delDeptAPI (id) {
    return request({
        url: `/company/department/${id}`,
        method: 'delete'
    })
}

// 封装一个添加部门的接口
export function addDeptAPI (data) {
    return request({
        url: '/company/department',
        method: 'post',
        data
    })
}

// 封装一个获取部门详情的接口
export function deptDetailAPI (id) {
    return request({
        url: `/company/department/${id}`
    })
}

// 封装一个修改部门的接口
export function editDeptAPI (data) {
    return request({
        url: `/company/department/${data.id}`,
        method: 'put',
        data
    })
}